// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者，助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------

import request from '@/utils/requestPro';

// 手机号验证码登录
export function PhoneCaptchaApi(data) {
  return request({
    url: '/admin/merchant/mobile/captcha',
    method: 'post',
	data,
	opt:{ noAuth : true }
  });
  
}

// 发送短信登录验证码
export function codeApi(data) {
  return request({
    url: '/admin/merchant/send/code',
    method: 'post',
	data,
	opt:{ noAuth : true }
  });
}

export function login(data) {
  return request({
    url: '/admin/merchant/login',
    method: 'post',
    data,
	opt:{ noAuth : true }
  });
}

export function getInfo() {
  return request({
    url: '/admin/merchant/getAdminInfoByToken',
    method: 'get',
  });
}

export function logout() {
  return request({
    url: '/admin/merchant/logout',
    method: 'get',
  });
}

/**
 * 会员管理 列表
 * @param pram
 */
export function userListApi(params) {
  return request({
    url: `/admin/merchant/user/list`,
    method: 'get',
    params,
  });
}

/**
 *获取登录页图片
 */
export function getLoginPicApi() {
  return request({
    url: `/admin/merchant/getLoginPic`,
    method: 'get',
  });
}

/**
 * @description 验证码
 */
export function captchaApi() {
  return request({
    url: `/publicly/validate/code/get`,
    method: 'get',
  });
}

/**
 * @description 用户详情列表
 */
export function userDetailApi(id) {
  return request({
    url: `/admin/merchant/user/detail/${id}`,
    method: 'get',
  });
}

/**
 * @description 添加常用联系人
 */
export function saveContactsApi(data) {
  return request({
    url: `/admin/appHome/contacts/save/contacts`,
    method: 'post',
	data
  });
}


/**
 * @description 查询常用联系人
 */
export function getContactsApi(params) {
  return request({
    url: `/admin/appHome/contacts/get/contacts`,
    method: 'get',
	params
  });
}

/**
 * @description 删除常用联系人
 */
export function deleteContactsApi(data) {
  return request({
    url: `/admin/appHome/contacts/remove/contacts`,
    method: 'delete',
	data
  });
}


/**
 * @description 修改常用联系人
 */
export function updateContactsApi(data) {
  return request({
    url: `/admin/appHome/contacts/update/contacts`,
    method: 'put',
	data
  });
}